<template>
  <div class="app-container">
    <!-- 系统结论 -->
    <div  class="box">
      <span class="l_title">系统结论</span>
      <el-row  class="infolist infolist_top">
        <el-col :span="6">综合评分：{{detail.Rule.result.final_weight}}</el-col>
        <el-col :span="6">审核建议：{{detail.Rule.result.final_decision}}</el-col>
        <el-col :span="24" class="mgtop">分值标注说明：分值在 0~100 之间，分值越高风险越大，（0,79) 建议通过，(80,100)建议拒绝。</el-col>
      </el-row>
    </div>
    <el-divider></el-divider>
    
     <!-- 风险名单检测 -->
    <div  class="box">
      <span class="l_title">规则命中列表</span>
      <el-row  class="infolist infolist_top">
        <el-col :span="24" class="red"><span v-for="(item,index) in detail.hit_arr ">{{item}}、</span></el-col>
      </el-row>
    </div>
    <el-divider></el-divider>
    <!-- 自然人识别 -->
    <div  class="box">
      <span class="l_title">自然人识别</span>
      <el-row  class="infolist infolist_top">
        <el-col :span="24" v-bind:class="[{'red':person.BadInfoPro.result>0}]">自然人识别：{{person.result_name}}</el-col>
      </el-row>
    </div>
    <el-divider></el-divider>
    <!-- 限高 -->
    <div  class="box">
      <span class="l_title">法院执行</span>
      <el-row  class="infolist infolist_top" v-for="(item,index) in height ">
        <el-col :span="4" class="red">姓名：{{item.iname}}</el-col>
        <el-col :span="6" class="red">执行法院：{{item.courtname}}</el-col>
        <el-col :span="4" class="red">类型：{{item.datatype}}</el-col>
        <el-col :span="5" class="red">字号：{{item.gistcid||item.casecode}}</el-col>
        <el-col :span="5" class="red">发布时间：{{item.publishdate}}</el-col>
      </el-row>
    </div>
    <el-divider></el-divider>
    <!-- 申请时间间隔 -->
    <div  class="box" v-if="loan.fst||loan.lst">
      <span class="l_title">借款申请时间间隔</span>
      <el-row  class="infolist infolist_top">
        <el-col :span="6">最早申请距今天数：{{loan.fst[0].value}}</el-col>
        <el-col :span="6">最近申请距今天数：{{loan.lst[0].value}}</el-col>
      </el-row>
    </div>
    <el-divider></el-divider>
    <!-- 7天内申请人在平台申请借款数 -->
    <div  class="box" v-if="loan.d7">
      <span class="l_title">7天内申请人在平台申请借款数</span>
      <el-row  class="infolist infolist_top">
        <el-col :span="6" v-bind:class="[{'mgtop':index>3}]"  v-for="(item,index) in loan.d7">{{item.name}}：{{item.value}}</el-col>
      </el-row>
    </div>
    <el-divider  v-if="loan.d7"></el-divider>
    <!-- 15天内申请人在平台申请借款数 -->
    <div  class="box" v-if="loan.d15">
      <span class="l_title">15天内申请人在平台申请借款数</span>
      <el-row  class="infolist infolist_top">
        <el-col :span="6" v-bind:class="[{'mgtop':index>3}]"  v-for="(item,index) in loan.d15">{{item.name}}：{{item.value}}</el-col>
      </el-row>
    </div>
    <el-divider  v-if="loan.d15"></el-divider>
    <!-- 一个月内申请人在平台申请借款数 -->
    <div  class="box" v-if="loan.m1">
      <span class="l_title">一个月内申请人在平台申请借款数</span>
      <el-row  class="infolist infolist_top">
        <el-col :span="6" v-bind:class="[{'mgtop':index>3}]"  v-for="(item,index) in loan.m1">{{item.name}}：{{item.value}}</el-col>
      </el-row>
    </div>
    <el-divider  v-if="loan.m1"></el-divider>
    <!-- 三个月内申请人在平台申请借款数 -->
    <div  class="box" v-if="loan.m3">
      <span class="l_title">三个月内申请人在平台申请借款数</span>
      <el-row  class="infolist infolist_top">
        <el-col :span="6" v-bind:class="[{'mgtop':index>3}]"  v-for="(item,index) in loan.m3">{{item.name}}：{{item.value}}</el-col>
      </el-row>
    </div>
    <el-divider  v-if="loan.m3"></el-divider>
    <!-- 六个月内申请人在平台申请借款数 -->
    <div  class="box" v-if="loan.m6">
      <span class="l_title">六个月内申请人在平台申请借款数</span>
      <el-row  class="infolist infolist_top">
        <el-col :span="6" v-bind:class="[{'mgtop':index>3}]"  v-for="(item,index) in loan.m6">{{item.name}}：{{item.value}}</el-col>
      </el-row>
    </div>
    <el-divider  v-if="loan.m6"></el-divider>
    <!-- 一年内申请人在平台申请借款数 -->
    <div  class="box" v-if="loan.m12">
      <span class="l_title">一年内申请人在平台申请借款数</span>
      <el-row  class="infolist infolist_top">
        <el-col :span="6" v-bind:class="[{'mgtop':index>3}]"  v-for="(item,index) in loan.m12">{{item.name}}：{{item.value}}</el-col>
      </el-row>
    </div>
    <el-divider  v-if="loan.m12"></el-divider>
    
  </div>
</template>

<script>
  import {
    getBaiRongData
  } from '@/api/order'
  export default {
    data() {
      return {
        base: {
          "age": 0,
          "id_card_city": "",
          "ident_number": "",
          "mobile_address_city": "",
          "name": "",
          "phone": ""
        },
        loan:{},
        detail: {
          Rule:{
            result:{
              final_weight:'',
              final_decision:'',
            }
          }
        },
        person:{
          BadInfoPro:{
            result:0
          }
        },
        height:{},
        SpecialList_c:{},//特殊名单验证
        ApplyLoanStr:{},//借款意向验证
        ApplyLoanUsury:{},//借款风险勘测
        ExecutionLimited:{},//法院执行信息
      }
    },
    created() {
      let pam = {order_id:this.$route.params.order_id};
      this.getBaiRongData(pam)
    },
    methods: {
      getBaiRongData(pam) {
        getBaiRongData(pam).then(resp => {
          this.detail = resp.data.rule_data;
          this.loan = resp.data.rule_data.apply_loan_arr;
          this.person = resp.data.person;
          this.height = resp.data.height.ExecutionLimited;
        })
      },
      textcolor(t,lab){
          if(lab==1&&t=='命中'){
            return 'red'
          }
          if(lab==2&&t!='无记录'){
            return 'red'
          }
          if(lab==3&&(t!=0&&t!='无记录')){
            return 'red'
          }
          
      }
    }
  }
</script>

<style>
.app-container{font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;}
.box{margin-left:50px;margin-right: 50px;}
.toinfo{text-align: right;}
.infolist_top{margin-top:12px;}
.infolist{color:#333;font-size:14px;margin-left: 10px;}
.infolist_file{color:#1890FF;font-size:15px;margin-left: 10px;}
.mgtop{margin-top:12px}
.el-divider--horizontal{margin:12px 0;}
.l_title{font-size:14px;color:#111;font-weight: 600;}
.grid-content{border:none}
.red{color:red}
</style>
